<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Karaoke.pe</title>
	
	<%@include file="scripts.jsp" %>
    <%@page import="java.util.Collection"%>
<%@page import="karaoke.modelo.Mensaje"%>
<%@page import="karaoke.negocio.GestionMensaje"%>	

<style type="text/css" title="currentStyle">
		
		@import "css/DT_bootstrap.css";
		</style>		
		<script type="text/javascript" language="javascript" src="js/jquery.js"></script>
		<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
			
</head>
<body class="preview" id="top">
	
<%@include file="header.jsp" %>

<div class="container">
<form id="FormLocal" class="form-horizontal" action="MensajeServlet" method="post">
<fieldset>

<!-- Form Name -->
<legend>Listado de Mensajes</legend>

<!-- Select Basic 
<div class="control-group" class="span6">
  <label class="control-label">Local</label>
  <div class="controls">
    <select id="idLocal" name="idLocal" class="input-large" >
    <%
	/*Collection<Local> locales = null;
	GestionLocales negocio = new GestionLocales();
	
	 locales = negocio.buscarPorNombre("");
	
	if (locales != null) {
		for (Local l :locales)	{
			out.println("<option value="+l.getIdlocal()+">"+l.getNombre()+"</option>");
		}
	}*/
	%>  


    </select>
  </div>
</div>
-->
<!-- Text input-->
<div class="control-group" class="span6">
  <label class="control-label">Nombre</label>
  <div class="controls">
   <input id="NombreLocal" name="NombreLocal" type="text"  class="input-large">
<!-- Button -->

    <button id="Buscar" name="Buscar" formaction="MensajeServlet" class="btn btn-mini" type="submit">Buscar</button>

 	<%
		Collection<Mensaje> mensaje = (Collection<Mensaje>) request.getAttribute("MENSAJES_ENCONTRADOS");
	%>
    
  </div>
</div>
			
<!-- Button (Double) -->
<div class="control-group" class="span8">
 
  <div class="controls" class="span2">
    <button id="Registrar" href="#RegistrarModal" name="Registrar" class="btn btn-mini btn-primary" data-toggle="modal">Registrar</button>
    <button id="Modificar" href="#ModificarModal" name="Modificar" class="btn btn-mini btn-primary" data-toggle="modal">Modificar</button>
    <button id="Eliminar" name="Eliminar" class="btn btn-mini btn-primary">Eliminar</button>
    </div>
</div>

</fieldset>

<div id="demo" class="span8">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
	<thead>
		<tr>
			<th>id.</th>
			<th>Usuario</th>
			<th>Mensaje</th>
			<th>Eliminado</th>
		</tr>
	</thead>
	<tbody>
 	
	<%
	String checked = "";
	if (mensaje != null) {
		for (Mensaje x : mensaje)	{
			out.println("<tr class='gradeX'>");
			out.println("<td>"+x.getIdmensaje()+"</td>");
			out.println("<td>"+x.getUsuario()+"</td>");
			out.println("<td>"+x.getContenido()+"</td>");
			checked = x.getElog()==1?"checked='checked'":"";
			out.println("<td class=\"center\"> <input type='checkbox' id='"+ x.getIdmensaje() +"' "+ checked + "></td>");
			out.println("</tr>");
		}
	}
		%>
	</tbody>

</table>



</div>
<div class="spacer"></div>

</form>
<!--   <form class="form-horizontal" >
   <div id="ModificarModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		  <div class="modal-header">
		    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
		    <h3 id="myModalLabel">Modificar Sala</h3>
		  </div>
		  <div class="modal-body">
		  <fieldset>
			
			<div class="control-group">
			  <label class="control-label">Local</label>
			  <div class="controls">
			    <input id="Local" name="Local" type="text" class="input-medium" disabled="disabled" >
			  </div>
			</div>
			
			
			<div class="control-group">
			  <label class="control-label">Id</label>
			  <div class="controls">
			    <input id="Id" name="Id" type="text" class="input-mini" disabled="disabled">
			    
			  </div>
			</div>
			
			
			<div class="control-group">
			  <label class="control-label">Nombre</label>
			  <div class="controls">
			    <input id="Nombre" name="Nombre" type="text" class="input-xlarge" required>
			    
			  </div>
			</div>
			

			<div class="control-group">
			  <label class="control-label">Capacidad</label>
			  <div class="controls">
			    <input id="Capacidad" name="Capacidad" type="number" class="input-mini" min="1"  required>
			    
			  </div>
			</div>

			<div class="control-group">
			  <label class="control-label">Descripci&oacute;n</label>
			  <div class="controls">                     
			    <textarea id="Descripcion" name="Descripcion"></textarea>
			  </div>
			</div>
			
			
			<div class="control-group">
			  <label class="control-label"></label>
			  <div class="controls">
			    <label class="checkbox">
			      <input type="checkbox" name="Eliminado" value="Eliminado">
			      Eliminado
			    </label>
			  </div>
			</div>
			
			
			</fieldset>
		  </div>
		  <div class="modal-footer">
  
		    <button class="btn btn-mini btn-primary">Grabar</button> 
		    <button class="btn btn-mini" data-dismiss="modal" aria-hidden="true">Cerrar</button>
		   
		  </div>
	</div>	  
	
<div id="RegistrarModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		  <div class="modal-header">
		    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
		    <h3 id="myModalLabel">Registrar Sala</h3>
		  </div>
		  <div class="modal-body">
		  <fieldset>

			<div class="control-group">
			  <label class="control-label">Local</label>
			  <div class="controls">
			    <input id="Local" name="Local" type="text" class="input-medium" disabled="disabled" >
			  </div>
			</div>

			<div class="control-group">
			  <label class="control-label">Nombre</label>
			  <div class="controls">
			    <input id="Nombre" name="Nombre"  type="text" class="input-xlarge" required>
			    
			  </div>
			</div>
			<div class="control-group">
			  <label class="control-label">Capacidad</label>
			  <div class="controls">
			    <input id="Capacidad" name="Capacidad" type="number" class="input-mini" min="1"  required>
			  </div>
			</div>
			<div class="control-group">
			  <label class="control-label">Descripci&oacute;n</label>
			  <div class="controls">                     
			    <textarea id="Descripcion" name="Descripcion"></textarea>
			  </div>
			</div>
			</fieldset>
		  </div>
		  <div class="modal-footer">
		    <button class="btn btn-mini btn-primary">Grabar</button> 
		    <button class="btn btn-mini" data-dismiss="modal" aria-hidden="true">Cerrar</button>
		   
		  </div>
	</div>	  

</form>
-->

 </div> <!-- /container -->

 <%@include file="footer.jsp" %>
 <%@include file="lejavascript.jsp" %>
	
</body>
</html>